import http from "@/service/request";
import type { params } from "../type";

enum API {
  // 登录
  USER_LOGIN = "/api/shop/login",
  // 用户注册
  USER_REGISTER = "/api/shop/register",
  //   根据token获取用户信息
  GET_USER_INFO = "/api/shop/user/userInfo",
}

export function api_user_login(params: params) {
  return http({
    method: "POST",
    url: API.USER_LOGIN,
    data: params,
  });
}

export function api_user_register(params: params) {
  return http({
    method: "POST",
    url: API.USER_REGISTER,
    data: params,
  });
}

export function api_get_user_info() {
  return http({
    method: "GET",
    url: API.GET_USER_INFO,
  });
}
